﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DataAccess;

namespace BussinesLogic
{
    public class Folio
    {
       
        private ArrayList _Lineas;

        public int id
        { get; set; }

        public int NumFolio
        { get; set; }

        public string CodDocumento
        { get; set; }

        public int NumLineas
        { get; set; }

        public string NoExpediente
        { get; set; }

        public int Tipo
        { get; set; }


        public ArrayList Lineas
        {
            get
            {
                if (this._Lineas == null || this._Lineas.Count == 0)
                {
                    DataAccess.Factory.LineaFactoryDao tmpFactory = new DataAccess.Factory.LineaFactoryDao();
                    this._Lineas = tmpFactory.getLineasByFolio(this.NumFolio, this.NoExpediente, this.CodDocumento);
                }

                return this._Lineas;
            }
            set
            {
                this._Lineas = value;
            }
        }


        public Folio()
        { }


        #region Funciones Publicas
        public static Folio getFolio(int NumFolio, string CodDocumento, string NoExpediente)
        {
            DataAccess.Factory.FolioFactoryDao tmpFac = new DataAccess.Factory.FolioFactoryDao();

            return tmpFac.getFolio(NumFolio, CodDocumento, NoExpediente);
        }
        #endregion
    }
}
